<?php

    // TITLE: html
    // FILE: html.php
    // AUTHOR: dantira
    // CREATED: Mar 27, 2015, 9:08:21 AM

    function echoOptions($items, $target = null) {
	foreach  ($items as $item) {
	    $i = $item->getId();
	    $t = $item->getTitle();
	    $s = ($i == $target) ? ' selected': '';
	    echo '<option value="' . $i . '"' . $s . '>' . $t . '</option>' . "\n";
	}// end foreach items
    }// end echoOptions
    
    function repOptions($items, $target = null) {
	foreach  ($items as $item) {
	    $i = $item->getId();
	    $n = $item->getFullName();
	    $s = ($i == $target) ? ' selected': '';
	    echo '<option value="' . $i . '"' . $s . '>' . $n . '</option>' . "\n";
	}// end foreach items
    }// end echoOptions
    
    function regionOptions($items, $target = null) {
	foreach  ($items as $item) {
	    $i = $item->getId();
	    $t = $item->getTitle();
	    $c = $item->getCode();
	    $s = ($i == $target) ? ' selected': '';
	    echo '<option value="' . $i . '"' . $s . '>' . $c . ': ' . $t . '</option>' . "\n";
	}// end foreach items
    }// end echoOptions
    
?>